<template>
  <div> 
      <el-cascader :options="allCategory" v-model="selectedOptions" @change="handleChange" change-on-select></el-cascader>      
  </div>
</template>
<script>
export default {
  name: 'cascaderCategory',
  data() {
    return {
      pid: '',
      name: ''
    }
  },
  props: ['allCategory', 'selectedOptions'],
  methods: {
    handleChange(value) {
      this.pid = value[value.length - 1]
      // console.log(this.pid)
      this.$emit('getPid', this.pid)
    }
  }
}
</script>
